草庐IT

Android SDK Manager 安装特定版本的 NDK Bundle

全部标签

ruby - 强制 bundle 安装使用 https ://instead of git://for GitHub-based gems

我正在尝试构建一个Rails项目,因为我正在使用的主机无法访问Internet的git://协议(protocol)(端口9418),我收到如下错误Fetchinggit://github.com/pivotal/jasmine.gitfatal:unabletoconnecttogithub.com:github.com[0:192.30.252.130]:errno=Connectionrefused运行bundleinstall时。GemFile中的相关行没有指定git://作为协议(protocol),它只是指向GitHub作为gem的源gem'jasmine',:github

ruby-on-rails - Rails 安装在 Ubuntu 上失败,错误为 "cannot load such file -- mkmf"

我在Ubuntu11上安装Rails时遇到了这个问题:root@salah:/home/salah/rubygems-1.8.15#sudogeminstallmysqlFetching:mysql-2.8.1.gem(100%)Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingmysql:ERROR:Failedtobuildgemnativeextension./usr/bin/ruby1.9.1extconf.rb/usr/local/lib/site_ruby/1.9.1/rubygems/c

ruby-on-rails - 当您的 Gemfile 需要旧版本的 bundler 时如何将其设置为 `bundle install`?

我在一个有Gemfile的旧Rails项目中。我试图将gem添加到Gemfile和bundleinstall但出现错误:Bundlercouldnotfindcompatibleversionsforgem"bundler":InGemfile:rails(=3.0.0)rubydependsonbundler(~>1.0.0)rubyCurrentBundlerversion:bundler(1.1.5)ThisGemfilerequiresadifferentversionofBundler.它使用的Rails版本需要bundler~>1.0.0但我已经安装了1.1.5并且正在将它

ruby-on-rails - 在 Rails 5.1 及更高版本中使用什么代替 `render :text` (和 `render nothing: true` )?

Rails5.1removesawholeloadofpreviouslydeprecatedmethods.其中就有老friendrender:text。当您需要呈现一些文本,但又不想占用View模板的开销时,它非常有用。示例:rendertext:"ok"rendertext:t('business_rules.project_access_denied'),status:401用什么代替? 最佳答案 未弃用的方法是使用render:plainRailsGuideonLayoutsandRendering:2.2.6Render

ruby - 无法将 RVM 安装的 Ruby 与 sudo 一起使用

我已成功配置RVM以使用Ruby1.9.2,一切正常。但是,当我尝试使用sudo运行Ruby时,它说找不到RVM或Ruby:$ruby-vruby1.9.2p0(2010-08-18revision29036)[x86_64-linux]$sudoruby-v[sudo]passwordforadministrator:sudo:ruby:commandnotfound这是正确的行为还是我的RVM配置错误?也许我应该使用systemwideinstall? 最佳答案 使用rvmsudo命令代替sudo

ruby-on-rails - 为什么我在安装 PaperClip 时得到一个 "undefined method for ` has_attached_file`?

我刚刚安装了Paperclip插件,但收到以下错误消息,但我不确定原因:NoMethodError(undefinedmethod`has_attached_file'for#):/Users/bgadoci/.gem/ruby/1.8/gems/will_paginate-2.3.12/lib/will_paginate/finder.rb:170:in`method_missing'app/models/post.rb:2app/controllers/posts_controller.rb:50:in`show'它引用了will_paginategem。据我所知,我的PostsC

Ruby 在特定目录下运行 shell 命令

我知道如何在Ruby中运行shell命令,例如:%x[#{cmd}]但是,我该如何指定一个目录来运行这个命令呢?有没有类似的脱shell方式,类似Python中的subprocess.Popen:subprocess.Popen(r'c:\mytool\tool.exe',cwd=r'd:\test\local')谢谢! 最佳答案 您可以使用Dir.chdir的block版本。在block内,您位于请求的目录中,在block之后,您仍在上一个目录中:Dir.chdir('mydir'){%x[#{cmd}]}

ruby - 在 OSX 10.10 Yosemite 上安装 Nokogiri

我最近升级到10.10Yosemitebeta,但安装Nokogiri时遇到问题。我正在使用RVM和Ruby1.9.3。我也遵循了这些步骤here并尝试按照Nokogiri主页上的说明进行操作。我已经通过Homebrew软件安装了libxml2(2.9.1)和libxslt(1.1.28),并尝试使用我的Xcode5安装和Xcode6beta中的命令行工具。geminstallnokogiri-v'1.5.5'Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingnokogiri:ERROR:Failed

ruby-on-rails - Rails bundler 不会在组内安装 gem

我有几个gem,包括ruby​​-debug,在一个名为:development的bundler组中。当我运行bundle命令时,这些gem将被忽略,它只会安装不在任何组中的gem。我怎样才能确保bundler不会忽略:development组中的gem?编辑:这就是我的Gemfile的样子。source'http://rubygems.org'gem'rails','3.0.1'#Authgemsgem"devise","1.1.3"gem"omniauth"#BundleMongoidgemsgem"mongoid","2.0.0.beta.19"gem"bson_ext"#Ass

ruby - 无法在 Windows 上安装 Aptana Studio 3.6

我想在Windows下使用AptanaStudio进行Rails开发。我目前有不同的开发工具和ide启动并运行(如git/ruby/jdk),我也想安装AptanaStudio,但我不能。下载并运行安装程序后,它会正常启动,在我选择目标目录后,它会开始下载先决条件。我有几个问题:一段时间后,它尝试安装node.js(好吧,我不确定为什么,但随它去吧),有时它安装正常,但有时它只是没有错误地失败,只告诉我aptana不能'安装先决条件。如果偶然安装了node.js,它会尝试安装msysgit(同样,我不知道为什么,因为我已经安装了git并将其添加到PATH)。安装msysgit完成后,我